<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin:0; padding:0;
        }
        html,body{
            width: 100%;height: 100%;
        }
        
        body{
            background: url(https://voidtech.cn/i/2022/11/24/dxky5s.jpg);
            background-size: 100% 100%;
            background-position: center center;
            overflow: auto;
        }
        .box{
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #shuRuKuang{
            border: 0;
            border-bottom: 2px solid #fff;
            padding: 4px 2px;
            display: block;
            background: 0;
            line-height: 1.5;
            outline: none;
            text-align: center;
            transition: border-color 0.2s ease-in-out;
            border-radius: 0;
            color: #fff;
            font-size: 2rem;
            max-width: 90%;
        }
        #anNiu{
            margin-left: -50px;
            margin-right: 10px;
            color: #ccc;
            border-radius: 50%;
            height: 40px;
            width: 40px;
            text-align: center;
            line-height: 30px;
            cursor: pointer;
        }
        input::placeholder{
            color:#ccc;
        }
        input::-webkit-input-placeholder{
            color: #ccc;
        }
        
    </style>
</head>
<body>
    <div class="box">
        <input placeholder="你的梦想是什么？" id="shuRuKuang"/>
        <span id="anNiu" onclick="change()">✔</span>
    </div>
    <script>
        let youShi = false;

        function change() {
            let anNiu = document.getElementById("anNiu");
            let shuRuKuang = document.getElementById("shuRuKuang");

            if (youShi){
                youShi = false;
                anNiu.innerText = "✔";
                shuRuKuang.style.borderBottomColor = "#fff";
                shuRuKuang.value = "";
                shuRuKuang.readOnly = false;
                window.localStorage.removeItem("shi")
            } else{
                youShi = true;
                anNiu.innerText = "X";
                shuRuKuang.style.borderBottomColor = "transparent";
                shuRuKuang.readOnly = true;
                window.localStorage.setItem("shi",shuRuKuang.value)
            }
        }
    
        let data = window.localStorage.getItem("shi");
        if (data) {
            document.getElementById("shuRuKuang").value = data;    
            change();        
        }

    </script>
    <div style="display: flex; justify-content: center">
        <button style="justify-content: center"> <a href="index.html">返回首页</a></button>
</div>

</body>
</html>